<template>
  <div class="dashboard-editor-container">
    <github-corner class="github-corner" />

    <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
      <line-chart :chart-data="lineChartData" />
    </el-row>
  </div>
</template>

<script>
import GithubCorner from '@/components/GithubCorner'
import LineChart from './components/LineChart'
import { quizCase } from '@/api/quiz'

export default {
  name: 'Dashboard',
  components: {
    GithubCorner,
    LineChart
  },
  data() {
    return {
      lineChartData: {}
    }
  },
  created() {
    this.handle()
  },
  methods: {
    handle() {
      this.lineChartData = {
        topAccuracyData: [0, 0.1, 0.2, 0.4, 0.6, 0.80, 1],
        botAccuracyData: [1, 2, 3, 4, 5, 6, 7]
      }
      quizCase().then(response => {
        const { data } = response
        console.log('获取的数据', data)
        this.lineChartData = data
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .github-corner {
    position: absolute;
    top: 0px;
    border: 0;
    right: 0;
  }

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width: 1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
